package org.arch_learn.ebp.controller;

import org.arch_learn.ebp.po.Account;
import org.arch_learn.ebp.service.DemoService;
import org.arch_learn.mvc.annos.AutoWired;
import org.arch_learn.mvc.annos.Controller;
import org.arch_learn.mvc.annos.RequestMapping;
import org.arch_learn.mvc.annos.Security;

@Controller
@RequestMapping(value = "/demo")
public class DemoController {

    @AutoWired(value = "demoService")
    private DemoService demoService;

//    @Security(names = {"张三"})
    @RequestMapping(value = "/get")
    public void get(String cardNo) {
       Account account = demoService.queryAccountByCardNo(cardNo);
        System.out.println("------" + account.toString());
    }

    @RequestMapping(value = "/transfer")
    public void transfer(String from,String to,String amount) {
        demoService.transfer(from,to,amount);
    }
}
